#include<stdio.h>
struct student{
    int score;
    int rank;  
}stu[5];
int main (){
    stu[0].score = 5;
    stu[1].score = 4;
    stu[2].score = 4;
    stu[3].score = 4;
    stu[4].score = 1;

    // 对于已经排好序的数组
    stu[0].rank = 1;
    for(int i=1;i<5;i++){
        if(stu[i].score==stu[i-1].score){
            stu[i].rank = stu[i-1].rank;
        } 
        else{
            stu[i].rank = i+1;
        }            
    }
    for(int i=0;i<5;i++){
        printf("%d\n",stu[i].rank);
    }
    return 0;
}